package SV_HTTP_SPLIT;
import jakarta.servlet.http.*;
public class Vulnerable_02 {
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String url = req.getParameter("HIDDEN_URL");
        if (url.length() == 0) {
            generatePage(req, resp);
        } else {
            resp.sendRedirect(url);
        }
    }

    private void generatePage(HttpServletRequest req, HttpServletResponse resp) throws IOException {
        PrintWriter wr = resp.getWriter();
        wr.print("Hello, World!");
    }
}
